package com.ruoyi.project.mydy.recommandrecord.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.mydy.recommandrecord.mapper.DlRecommandRecordMapper;
import com.ruoyi.project.mydy.recommandrecord.domain.DlRecommandRecord;
import com.ruoyi.project.mydy.recommandrecord.service.IDlRecommandRecordService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 推荐记录Service业务层处理
 * 
 * @author mhg
 * @date 2021-10-07
 */
@Service
public class DlRecommandRecordServiceImpl implements IDlRecommandRecordService 
{
    @Autowired
    private DlRecommandRecordMapper dlRecommandRecordMapper;

    /**
     * 查询推荐记录
     * 
     * @param id 推荐记录主键
     * @return 推荐记录
     */
    @Override
    public DlRecommandRecord selectDlRecommandRecordById(Long id)
    {
        return dlRecommandRecordMapper.selectDlRecommandRecordById(id);
    }

    /**
     * 查询推荐记录列表
     * 
     * @param dlRecommandRecord 推荐记录
     * @return 推荐记录
     */
    @Override
    public List<DlRecommandRecord> selectDlRecommandRecordList(DlRecommandRecord dlRecommandRecord)
    {
        return dlRecommandRecordMapper.selectDlRecommandRecordList(dlRecommandRecord);
    }

    /**
     * 新增推荐记录
     * 
     * @param dlRecommandRecord 推荐记录
     * @return 结果
     */
    @Override
    public int insertDlRecommandRecord(DlRecommandRecord dlRecommandRecord)
    {
        dlRecommandRecord.setCreateTime(DateUtils.getNowDate());
        return dlRecommandRecordMapper.insertDlRecommandRecord(dlRecommandRecord);
    }

    /**
     * 修改推荐记录
     * 
     * @param dlRecommandRecord 推荐记录
     * @return 结果
     */
    @Override
    public int updateDlRecommandRecord(DlRecommandRecord dlRecommandRecord)
    {
        return dlRecommandRecordMapper.updateDlRecommandRecord(dlRecommandRecord);
    }

    /**
     * 批量删除推荐记录
     * 
     * @param ids 需要删除的推荐记录主键
     * @return 结果
     */
    @Override
    public int deleteDlRecommandRecordByIds(String ids)
    {
        return dlRecommandRecordMapper.deleteDlRecommandRecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除推荐记录信息
     * 
     * @param id 推荐记录主键
     * @return 结果
     */
    @Override
    public int deleteDlRecommandRecordById(Long id)
    {
        return dlRecommandRecordMapper.deleteDlRecommandRecordById(id);
    }
}
